Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scanOnTouchTap and improve touch scanning defaults #791

Merged
merged 3 commits into from
Apr 14, 2024

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented Mar 26, 2024

The current touch scanning options are extremely prone to accidental scans. Scrolling down a webpage or flipping a page in a book can get very annoying when every 2 seconds theres an accidental scan.

In the past with yomichan there were some very specific settings that could be used as a workaround to fix this and effectively get a touch tap gesture. Yomitan no longer allows this workaround. I looked into restoring this behavior and it turns out that behavior being possible was actually exploiting a bug and it's also a pain to set up anyways.

I've added scanOnTouchTap so we can have proper touch tap gesture support. The implementation is simple:

touchstart -> touchend = touchtap

touchstart -> touchmove -> touchend = no touchtap

I've also made this update settings to disable the previous defaults: scanOnTouchPress and scanOnTouchMove. Normally I wouldn't want to mess with existing settings like this but the previous defaults were so bad to use compared to this I think it's a worthy change. If messing with existing settings like this goes against the project's values I'll revert that.

Comparison in use:

Before:

before.mp4

After:

after.mp4

@Kuuuube Kuuuube requested a review from a team as a code owner March 26, 2024 01:13
Copy link

github-actions bot commented Mar 26, 2024

⚠️ Visual differences introduced by this PR; please validate if they are desirable.

View Playwright Report (note: open the "playwright-report" artifact)

@Casheeew Casheeew added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels Mar 28, 2024
Copy link
Collaborator

@StefanVukovic99 StefanVukovic99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (has a conflict though)

ext/js/language/text-scanner.js Outdated Show resolved Hide resolved
@Kuuuube
Copy link
Member Author

Kuuuube commented Apr 10, 2024

LGTM (has a conflict though)

Resolved

@jamesmaa jamesmaa added this pull request to the merge queue Apr 14, 2024
@jamesmaa jamesmaa removed this pull request from the merge queue due to a manual request Apr 14, 2024
@jamesmaa jamesmaa added this pull request to the merge queue Apr 14, 2024
Merged via the queue into yomidevs:master with commit 7df7e1b Apr 14, 2024
11 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Apr 16, 2024
* added Old Irish (SGA)

* Merge Yomitan Updates (#1)

* fix (#811)

* Add scanOnTouchTap and improve touch scanning defaults (#791)

* Add scanOnTouchTap

* Update version to 30

* Cleanup if statement

* log anki error when hiding button (#821)

* Fix noteInfos not getting assigned (#819)

* improve term sorting (#806)

* improve term sorting

* edge case

* fix: add missing handlebar entry (#823)

* fix: add missing handlebar entry

* fix: add new handlebar to tests

* Revert to using canAddNotes (#827)

Fix #818

* Remove unused canAdd (#824)

Co-authored-by: James Maa <[email protected]>

* Fix duplicate check not working across note types (#830)

* Fix duplicate check not working across note types

* Add invalidNoteId

---------

Co-authored-by: James Maa <[email protected]>

---------

Co-authored-by: StefanVukovic99 <[email protected]>
Co-authored-by: Kuuuube <[email protected]>
Co-authored-by: m-edlund <[email protected]>
Co-authored-by: Eloy Robillard <[email protected]>
Co-authored-by: James Maa <[email protected]>
Co-authored-by: James Maa <[email protected]>

* Revert "Merge Yomitan Updates (#1)"

This reverts commit 748dc22.

* Fix Static Analysis Error

* Fix eslint erro

---------

Co-authored-by: martholomew <[email protected]>
Co-authored-by: StefanVukovic99 <[email protected]>
Co-authored-by: Kuuuube <[email protected]>
Co-authored-by: m-edlund <[email protected]>
Co-authored-by: Eloy Robillard <[email protected]>
Co-authored-by: James Maa <[email protected]>
Co-authored-by: James Maa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants